﻿using System.Activities;

namespace System.Management.HyperV.Activities
{
    public class CreateDynamicDisk : CodeActivity
    {
        [RequiredArgument]
        public InArgument<string> DynamicDiskName { get; set; }

        [RequiredArgument]
        public InArgument<ulong> MaxInternalSize { get; set; }

        protected override void Execute(CodeActivityContext context)
        {
            using (var ims = new ImageManagementService())
            {
                ims.CreateDynamicVirtualHardDisk(
                    DynamicDiskName.Get(context),
                    MaxInternalSize.Get(context));
            }
        }
    }
}
